<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!--资源获取-->
    <base th:href="|${#request.getContextPath()}/|">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="static/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--layui-->
    <link rel="stylesheet" type="text/css" href="static/layui/css/layui.css"/>
    <script type="text/javascript" src="static/layui/layui.js"></script>
    <title>资讯列表</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    首页
    <span class="c-gray en">&gt;</span>
    用户管理

    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>

</nav>

<fieldset class="layui-elem-field">
    <div class="layui-field-box">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" id="username" name="title" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" style="width:300px" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                    <input type="password" id="password1" required lay-verify="required" placeholder="请输入密码" style="width:300px" autocomplete="off" class="layui-input">
                </div>

            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">再次输入密码</label>
                <div class="layui-input-inline">
                    <input type="password" id="password2" required lay-verify="required" placeholder="请输入密码" style="width:300px" autocomplete="off" class="layui-input">
                </div>

            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>

    </div>
</fieldset>
<script type="text/javascript" src="static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="static/my/js/post.js"></script>
<script type="text/javascript" src="static/my/js/util.js"></script>
<script>
    var dates;



    layui.use('form', function(){
        var form = layui.form;
        var swi ;
        form.on('switch()', function(data){
            swi = data.elem.checked; //得到美化后的DOM对象
            console.log(swi);
        });
        //监听提交
        form.on('submit(formDemo)', function(data){
            if($("#password1").val() != $("#password2").val()){
                layer.msg('两次密码不一致');
            }else {
                console.log($("#admin").checkbox)
                $.ajax({
                    url:"/insertUser",
                    type:"POST",
                    data:{
                        "password":$("#password1").val(),
                        "username":$("#username").val()
                    },success:function () {
                        layer.msg('成功');
                    }
                })
            }
            return false;
        });
    });



</script>

<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="static/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript">


</script>

</body>
</html>
